public class ExerciseSystem {
    public static void main(String[] args) {
        // 1. 创建加法习题并生成5道题
        Exercise addExercise = new Exercise("二年级上册加法练习题");
        try {
            addExercise.generateAddExpressions(5); // 生成5道加法题
            System.out.println("=== 加法习题 ===");
            System.out.println(addExercise.getFormattedDisplay());
        } catch (IllegalArgumentException e) {
            System.out.println("加法习题生成失败：" + e.getMessage());
        }

        // 2. 创建减法习题并生成3道题
        Exercise subtractExercise = new Exercise("二年级上册减法练习题");
        try {
            subtractExercise.generateSubtractExpressions(3); // 生成3道减法题
            System.out.println("\n=== 减法习题 ===");
            System.out.println(subtractExercise.getFormattedDisplay());
        } catch (IllegalArgumentException e) {
            System.out.println("减法习题生成失败：" + e.getMessage());
        }
    }
}
